package kr.or.javacafe.USCM.USCM105.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import kr.or.javacafe.USCM.USCM105.service.USCM105Service;
import kr.or.javacafe.USCM.USCM105.web.USCM105Controller;

public class USCM105Controller extends MultiActionController{
	protected final static Log logger = LogFactory
			.getLog(USCM105Controller.class);

	private USCM105Service uscm105Service;

	public void setUscm105Service(USCM105Service uscm105Service) {
		this.uscm105Service = uscm105Service;
	}

	public ModelAndView uscm105Main(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ModelAndView returnPage = new ModelAndView("USCM105/uscm105Main");
		return returnPage;
	}

	public ModelAndView findMemberList(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("Entering " + getClass() + "." + "ajax_path_normal()");
		}

		List objList = uscm105Service.findMemberList();

		ModelAndView returnPage = new ModelAndView("JSON", "JSON_DATA", objList);
		returnPage.addObject("objList", objList);

		return returnPage;
	}
}
